<template>
  <div class="TopType center-wrap">
    <div class="menutype-container">
      <!-- 左侧 -->
      <div class="menutype-left">
        <div class="menutype-left-content">
          <div class="menutype-left-item" v-for="(item,index) in menutypeLeft" :key="index">
            <div class="menutype-top-info" :style="'background:'+item.bg">
              <i :class="item.icon" v-if="item.icon"></i>
              <div class="menutype-top-img">
                <img :src="item.img" alt="">
                <span v-if="item.img"></span>
              </div>
            </div>
            <span class="menutype-bottom-title">{{item.title}}</span>
          </div>
        </div>
      </div>
      <span class="menutype-line"></span>
      <!-- 中间 -->
      <div class="menunav-container">
        <span class="menunav-item" v-for="(item,index) in menutypemiddle" :key="index">
          <div class="menunav-item-content" >
            <span  class="menunav-title" v-if="index == menutypemiddle.length-1 ? false : true">
              <el-popover :placement="item.direction" popper-class="menutype-popover" trigger="hover" :offset='item.direction == "bottom-start" ? -10 : 10' :disabled="item.list==''?true:false" :popper-options="{ boundariesElement: 'body', gpuAcceleration: false }">
                <el-scrollbar style="height:100%">
                  <div class="menutype-box">
                    <div>
                      <span class="menutype-item" ref="menutypeItem" v-for="(items,indexs) in item.list" :key="indexs">{{items}}</span>
                    </div>
                  </div>
                </el-scrollbar>
                <span class="reftitle" slot="reference">{{item.title}}</span>
               </el-popover>
               <i :class="item.icon"></i>
               <em class="menunav-em" v-if="item.num">{{item.num}}</em>
            </span>
          </div>
        </span>
      </div>
      <span class="menutype-line"></span>
      <!-- 右侧 -->
      <div class="menutype-right">
        <div class="menutype-right-content">
            <div class="menutype-right-item" v-for="(item,index) in menutyperight" :key="index">
              <el-popover placement="bottom" popper-class="menutype-popover" trigger="hover" :offset='-2' :disabled="item.list==''?true:false" :popper-options="{ boundariesElement: 'body', gpuAcceleration: false }">
                <el-scrollbar style="height:100%">
                  <div class="menutype-live">
                    <span v-for="(items,indexs) in item.list" :key="indexs">{{items}}</span>
                  </div>
                </el-scrollbar>
                <span slot="reference" class="menutype-right-textbox">
                  <i class="menutype-right-item-icon" :class="item.icon" :style="'color:rgb('+item.color+')'"></i>
                  <span class="menutype-right-item-title">{{item.title}}</span>
                </span>
              </el-popover>
            </div>
        </div>
      </div>
    </div>
    <!-- <div style="width:100%;height:3000px"></div> -->
  </div>
</template>

<script>
  export default{
    name:'TopType',
    data(){
      return{
        // 左侧
        menutypeLeft:[
          {icon:'iconfont icon-shouye',img:'',title:'首页',bg:'#ff5c7c'},
          {icon:'',img:require('../../assets/img/menu1.gif'),title:'动态'},
          {icon:'iconfont icon-paihang',img:'',title:'排行',bg:'#00a1d6'},
          {icon:'',img:require('../../assets/img/yxlm.png'),title:'频道'},
        ],
        menutypemiddle:[
          {title:'动画',num:'999+',direction:'top-start',list:['MAD·AMV','MMD·3D','短书·手书·配音','手办·模玩','特摄','综合']},
          {title:'番剧',num:'278',direction:'bottom-start',list:['连载动画','完结动画','资讯','官方延伸','新番时间表','番剧索引']},
          {title:'音乐',num:'999+',direction:'top-start',list:['原创音乐','翻唱','VOCALOID·UTAU','电音','演奏','MV','音乐现场','音乐综合','音频','说唱']},
          {title:'国创',num:'458',direction:'bottom-start',list:['国产动画','国产原创相关','布袋戏','动态漫·广播剧','资讯','新番时间表','国产动画索引']},
          {title:'舞蹈',num:'819',direction:'top-start',list:['宅舞','街舞','明星舞蹈','中国舞','舞蹈综合','舞蹈教程']},
          {title:'游戏',num:'999+',direction:'bottom-start',list:['单机游戏','电子竞技','手机游戏','网络游戏','桌游棋牌','GMV','音游','Mugen','游戏赛事']},
          {title:'知识',num:'999+',direction:'top-start',list:['科学科普','社科人文','财经','校园学习','职业职场','野生技术协会']},
          {title:'数码',num:'999+',direction:'bottom-start',list:['手机平板','电脑装机','摄影摄像','T影音智能']},
          {title:'生活',num:'999+',direction:'top-start',list:['日常','美食圈','动物圈','手工','绘画','运动','汽车','其他']},
          {title:'鬼畜',num:'273',direction:'bottom-start',list:['鬼畜调教','音MAD','人力VOCALOID','教程演示']},
          {title:'时尚',num:'999+',direction:'top-start',list:['美妆','服饰','健身','T台','风尚标']},
          {title:'资讯',num:'273',direction:'bottom-start',list:['热点','环球','社会','综合']},
          {title:'娱乐',num:'999+',direction:'top-start',list:['综艺','明星']},
          {title:'影视',num:'999+',direction:'bottom-start',list:['影视杂谈','影视剪辑','短片','预告·资讯']},
          {title:'放映厅',num:'156',direction:'top-start',list:['记录片','电影','电视剧']},
          {title:'搞笑',num:'999+',direction:'',list:[]},
          {title:'动物圈',num:'999+',direction:'',list:[]},
          {title:'美食圈',num:'999+',list:[]},
          {title:'单机游戏',num:'999+',list:[]},
          {title:'VLOG',num:'',list:[]},
          {title:'更多',icon:'iconfont icon-xia'}
        ],
        menutyperight:[
          {icon:'iconfont icon-zhuanlan',title:'专栏',color:'84,226,226',list:''},
          {icon:'iconfont icon-huodong1',title:'活动',color:'243,152,0',list:''},
          {icon:'iconfont icon-xiaoheiwu',title:'小黑屋',color:'255, 208, 67',list:''},
          {icon:'iconfont icon-zhibo',title:'直播',color:'72, 207, 229',list:['全部','游戏','手游','娱乐','电台','绘画']},
          {icon:'iconfont icon-youxi',title:'课堂',color:'255, 234, 133',list:''},
          {icon:'iconfont icon-music',title:'音乐PLUS',color:'61, 169, 211',list:''},
        ]
      }
    },
    methods:{

    },
    mounted() {
    }
  }
</script>

<style scoped>
  .menutype-container{
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    width: 100%;
  }
  .menutype-left{
    display: flex;
    align-items: center;
  }
  .menutype-left-content{
    display: flex;
  }
  .menutype-left-item{
    cursor: pointer;
    height: 68px;
    width: 50px;
    text-align: center;
    font-size: 14px;
    white-space: nowrap;
    border: 1px solid #fff;
    border-radius: 16px;
    transition:all .3s;
    box-sizing: border-box;
    color:#212121;
  }
  .menutype-left-item:hover{
    color:#00A1D6;
  }
  .menutype-top-info{
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    line-height: 36px;
    text-align: center;
    margin: 0 auto 4px;
  }
  .menutype-top-info>i{
    color:#fff;
    font-size: 22px;
    font-weight: 600;
  }
  .menutype-top-img{
    width: 36px;
    height: 36px;
    position: absolute;
    top:0;
    left:0;
  }
  .menutype-top-img>img{
    width: 36px;
    height: 36px;
    border-radius: 50%;
  }
  .menutype-top-img>span{
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fa5a57;
    border:2px solid #FFFFFF;
    right: -2px;
    right:-2px;
    box-sizing: border-box;
  }
  .menutype-line{
    display: inline-block;
    height: 46px;
    border-left: 1px solid #E7E7E7;
    margin: 0 8px;
  }
  /* 中间部分 */
  .menunav-container{
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    height: 68px;
    flex: 1;
  }
  .menunav-item-content{
    cursor: pointer;
    display: flex;
    height: 34px;
    align-items: center;
    font-size: 14px;
    white-space: nowrap;
  }
  .menunav-em{
    font-size: 12px;
    font-style: normal;
    display: inline-block;
    background: #73c9e5;
    border-radius: 2px;
    color:#FFFFFF;
    margin-left: 1px;
    transform: scale(0.85);
    width: 32px;
    height: 100%;
    text-align: center;
  }
  .menunav-item:hover .menunav-title{
    color:#00A1D6;
  }
  .reftitle{
    display: inline-block;
  }
  .menutype-box{
    display: flex;
    width: 100%;
    /* padding-right: 6px; */
    box-sizing: border-box;
    /* max-height: 148px; */
  }
  .menutype-box>div{
    width: 100%;
    max-height: 148px;
    display: flex;
    flex-direction: column;
  }
  .menutype-item{
    display: block;
    font-size: 12px;
    padding:10px 13px;
    height:37px;
    box-sizing: border-box;
    cursor: pointer;
  }
  .menutype-item:hover{
    color:#00A1D6;
  }
  /* 右侧 */
  .menutype-right{
    width: 220px;
  }
  .menutype-right-content{
    display: flex;
    flex-wrap: wrap;
  }
  .menutype-right-content>.menutype-right-item{
    height: 34px;
    display: flex;
    font-size: 14px;
    align-items: center;
    white-space: nowrap;
    cursor: pointer;
  }
  .menutype-right-item-icon{
    font-size:22px;
    vertical-align: middle;
    fill: currentColor;
    margin-left: 4px;
  }
  .menutype-right-item-title{
    vertical-align: middle;
  }
  .menutype-live{
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 148px;
  }
  .menutype-live>span{
    padding:10px 13px;
    cursor: pointer;
    height: 34px;
    font-size: 12px;
  }
  .menutype-right-textbox:hover .menutype-right-item-title{
    color: #00A1D6;
  }
  .menutype-live>span:hover{
    color: #00A1D6;
  }

</style>
<style>
  .menutype-popover{
    padding:0;
    min-width: 0;
    /* box-sizing: border-box; */
  }
</style>
